/**
 * 新用户注册
 */

// 预定义
var username;

//页面载入初始化
$( "body" ).ready( function( e )
{
	$( ":submit" ).bind( "click", submit );
	$( "body" ).bind( "keyup", function( e )
	{
		if( e.which == 13 )
			submit();
	} );
} );

function submit()
{
	var data = {};

	data.username = username;
	data.oldpassword = $( "#oldpassword" ).val();
	data.password = $( "#password" ).val();
	data.repassword = $( "#repassword" ).val();

	submitter.post( "personal_password_go.php", data, function( d )
	{
		if( d.err == 0 )
		{
			infopad.msg( d.msg );
		}
		else
		{
			infopad.err( d.msg );
		}
	}, "json" );
}
